from rest_framework import serializers
from app01 import models


class OncallInfoSerializer(serializers.ModelSerializer):
    start_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
    end_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
    class Meta:
        model = models.OncallInfo
        fields = ['dev_group', 'oncaller', 'time', 'start_time', 'end_time']

    # def create(self, validated_data):
    #     print(validated_data)


